package com.work.rabbitmqdemo.controller;

import com.work.rabbitmqdemo.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @RequestMapping(value = "/send")
    public String send(@RequestParam("msg") String msg){
        messageService.send(msg);
        return "发送的消息是" + msg;
    }
}
